<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/**
<span class='line'>  2</span>  * @fileoverview &lt;code>BE&lt;/code> (BeforeEffects) aims to be a collection of
<span class='line'>  3</span>  * useful extensions to the After Effects Object Model within ExtendScript.
<span class='line'>  4</span>  * &lt;code>BE&lt;/code> contains Objects that provide greater functionality and
<span class='line'>  5</span>  * reusability than the built-in After Effects objects as well as prototyple
<span class='line'>  6</span>  * modifications to the built-in Objects within JavaScript.
<span class='line'>  7</span>  * 
<span class='line'>  8</span>  * All prototype modifications to the built-in JavaScript Objects are handled
<span class='line'>  9</span>  * gently by checking to make sure the methods/fields that are added are not
<span class='line'> 10</span>  * already defined. This is helpful in that, if the standard Objects are
<span class='line'> 11</span>  * modified by future ECMA specifications (or ExtendScript is modified) and
<span class='line'> 12</span>  * they are named the same as methods/fields that &lt;code>BE&lt;/code> implements,
<span class='line'> 13</span>  * BeforeEffects will not overwrite the pre-defined methods. 
<span class='line'> 14</span>  * 
<span class='line'> 15</span>  * @author &lt;a href="mailto:collin.brooks@gmail.com">Collin Brooks&lt;/a>
<span class='line'> 16</span>  * @version 0.1.0 dev
<span class='line'> 17</span>  */</span><span class="WHIT">
<span class='line'> 18</span> 
<span class='line'> 19</span> </span><span class="COMM">/*jslint white: true, onevar: true, undef: true, newcap: true, regexp: true,
<span class='line'> 20</span>   plusplus: true, bitwise: true, maxlen: 79 */</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="COMM">/**
<span class='line'> 22</span>  * The &lt;code>BE&lt;/code> Object aims to be an all-purpose collection of useful
<span class='line'> 23</span>  * methods that increases efficiency in creating scripts for After Effects.
<span class='line'> 24</span>  * 
<span class='line'> 25</span>  * @returns {Object} The &lt;code>BE&lt;/code> Object
<span class='line'> 26</span>  * @version 0.1.0 dev
<span class='line'> 27</span>  * @namespace
<span class='line'> 28</span>  */</span><span class="WHIT">
<span class='line'> 29</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">BE</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="WHIT">    </span><span class="COMM">/*************************************************************************\
<span class='line'> 31</span>      * >>> Private Variables
<span class='line'> 32</span>     \*************************************************************************/</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT">	
<span class='line'> 34</span>     </span><span class="COMM">/**
<span class='line'> 35</span>      * A reference to this function's &lt;code>this&lt;/code> value for use within
<span class='line'> 36</span>      * methods/functions defined by the &lt;code>BE&lt;/code> Object.
<span class='line'> 37</span>      * 
<span class='line'> 38</span>      * @type {Object}
<span class='line'> 39</span>      * @inner
<span class='line'> 40</span>      * @private
<span class='line'> 41</span>      */</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT">    
<span class='line'> 43</span>     </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">that</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 44</span> 
<span class='line'> 45</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'> 46</span>      * The current version of the &lt;code>BE&lt;/code> object.
<span class='line'> 47</span> 	 *
<span class='line'> 48</span> 	 * @type {String}
<span class='line'> 49</span> 	 * @private
<span class='line'> 50</span>      * @inner
<span class='line'> 51</span> 	 */</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT">	</span><span class="NAME">version_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"0.1.0 dev"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 53</span> 
<span class='line'> 54</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'> 55</span> 	 * &lt;p>The current debug level. Each level builds upon the previous
<span class='line'> 56</span> 	 * level. Errors are automatically output to the log. Possible values:
<span class='line'> 57</span> 	 * &lt;ul>
<span class='line'> 58</span> 	 * &lt;li>0 - No information output to console&lt;/li>
<span class='line'> 59</span> 	 * &lt;li>1 - Info output to the console&lt;/li>
<span class='line'> 60</span> 	 * &lt;li>2 - Warnings and Info output to the console&lt;/li>
<span class='line'> 61</span> 	 * &lt;/ul>
<span class='line'> 62</span> 	 * &lt;/p>
<span class='line'> 63</span> 	 * @type {Number}
<span class='line'> 64</span>      * @private
<span class='line'> 65</span>      * @inner
<span class='line'> 66</span> 	 */</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT">	</span><span class="NAME">debug_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 68</span> 
<span class='line'> 69</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'> 70</span>      * The base folder, relative to this file, where the "inc" folder can be
<span class='line'> 71</span>      * found.
<span class='line'> 72</span>      * @type {Folder}
<span class='line'> 73</span>      * @private
<span class='line'> 74</span>      * @inner
<span class='line'> 75</span>      */</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="WHIT">    </span><span class="NAME">includeFolder_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Folder</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">File</span><span class="PUNC">(</span><span class="NAME">$.fileName</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">parent.fsName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'> 77</span> </span><span class="WHIT">        </span><span class="STRN">"/inc"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">fsName</span><span class="PUNC">,</span><span class="WHIT"> 
<span class='line'> 78</span> 
<span class='line'> 79</span>     </span><span class="COMM">/**
<span class='line'> 80</span>      * An array of filenames, relative to the inc/ folder, where the
<span class='line'> 81</span>      * modules/languages can be found.
<span class='line'> 82</span>      * @type {Array}
<span class='line'> 83</span>      * @private
<span class='line'> 84</span>      * @inner
<span class='line'> 85</span>      */</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT">    </span><span class="NAME">includes_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT">        </span><span class="COMM">// Modules</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT">        </span><span class="STRN">"/modules/BE_prototypes.jsxinc"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT">        </span><span class="STRN">"/modules/BE_proj.jsxinc"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT">        </span><span class="STRN">"/modules/BE_comp.jsxinc"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT">        </span><span class="STRN">"/modules/BE_layer.jsxinc"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT">        </span><span class="STRN">"/modules/BE_time.jsxinc"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT">        </span><span class="STRN">"/modules/BE_ui.jsxinc"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="WHIT">        </span><span class="STRN">"/modules/BE_SettingsManager.jsxinc"</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="WHIT">        </span><span class="COMM">//Languages</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT">    </span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 97</span> 
<span class='line'> 98</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'> 99</span>      * An array of includes that have already been included. This helps make
<span class='line'>100</span>      * sure a module does not define a resource more than once.
<span class='line'>101</span>      * @type {Array}
<span class='line'>102</span>      * @private
<span class='line'>103</span>      * @inner
<span class='line'>104</span>      */</span><span class="WHIT">
<span class='line'>105</span> </span><span class="WHIT">    </span><span class="NAME">included_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>106</span> </span><span class="WHIT">    
<span class='line'>107</span>     </span><span class="COMM">/*************************************************************************\
<span class='line'>108</span>      * >>> Public Properties:
<span class='line'>109</span>     \*************************************************************************/</span><span class="WHIT">
<span class='line'>110</span> </span><span class="WHIT">    
<span class='line'>111</span>     </span><span class="COMM">/**
<span class='line'>112</span>      * Returns true if the specified value is not |undefined|.
<span class='line'>113</span>      * WARNING: Do not use this to test if an object has a property. Use the in
<span class='line'>114</span>      * operator instead.  Additionally, this function assumes that the global
<span class='line'>115</span>      * undefined variable has not been redefined.
<span class='line'>116</span>      * @param {*} val Variable to test.
<span class='line'>117</span>      * @returns {boolean} Whether variable is defined.
<span class='line'>118</span>      */</span><span class="WHIT">
<span class='line'>119</span> </span><span class="WHIT">    </span><span class="NAME">this.isDef</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>120</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">val</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>122</span> 
<span class='line'>123</span> 
<span class='line'>124</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>125</span>      * Returns true if the specified value is |null|
<span class='line'>126</span>      * @param {*} val Variable to test.
<span class='line'>127</span>      * @returns {boolean} Whether variable is null.
<span class='line'>128</span>      */</span><span class="WHIT">
<span class='line'>129</span> </span><span class="WHIT">    </span><span class="NAME">this.isNull</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>130</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">val</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>131</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>132</span> 
<span class='line'>133</span> 
<span class='line'>134</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>135</span>      * Returns true if the specified value is defined and not null
<span class='line'>136</span>      * @param {*} val Variable to test.
<span class='line'>137</span>      * @returns {boolean} Whether variable is defined and not null.
<span class='line'>138</span>      */</span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT">    </span><span class="NAME">this.isDefAndNotNull</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>140</span> </span><span class="WHIT">      </span><span class="COMM">// Note that undefined == null.</span><span class="WHIT">
<span class='line'>141</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">val</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>142</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>143</span> </span><span class="WHIT">    
<span class='line'>144</span>     </span><span class="COMM">/**
<span class='line'>145</span>      * Returns true if the specified value is a string
<span class='line'>146</span>      * @param {*} val Variable to test.
<span class='line'>147</span>      * @returns {boolean} Whether variable is a string.
<span class='line'>148</span>      */</span><span class="WHIT">
<span class='line'>149</span> </span><span class="WHIT">    </span><span class="NAME">this.isString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>150</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">val</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>151</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>152</span> 
<span class='line'>153</span> 
<span class='line'>154</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>155</span>      * Returns true if the specified value is a boolean
<span class='line'>156</span>      * @param {*} val Variable to test.
<span class='line'>157</span>      * @returns {boolean} Whether variable is boolean.
<span class='line'>158</span>      */</span><span class="WHIT">
<span class='line'>159</span> </span><span class="WHIT">    </span><span class="NAME">this.isBoolean</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>160</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">val</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'boolean'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>161</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>162</span> 
<span class='line'>163</span> 
<span class='line'>164</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>165</span>      * Returns true if the specified value is a number
<span class='line'>166</span>      * @param {*} val Variable to test.
<span class='line'>167</span>      * @returns {boolean} Whether variable is a number.
<span class='line'>168</span>      */</span><span class="WHIT">
<span class='line'>169</span> </span><span class="WHIT">    </span><span class="NAME">this.isNumber</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>170</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">val</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'number'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>171</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>172</span> 
<span class='line'>173</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>174</span>      * Returns true if the specified value is a function.
<span class='line'>175</span>      * @param {*} val Variable to test.
<span class='line'>176</span>      * @returns {boolean} Whether variable is a function.
<span class='line'>177</span>      */</span><span class="WHIT">
<span class='line'>178</span> </span><span class="WHIT">    </span><span class="NAME">this.isFunc</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>179</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="PUNC">(</span><span class="NAME">val</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">Object</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'>180</span> </span><span class="WHIT">            </span><span class="PUNC">(</span><span class="NAME">Object.prototype.toString.call</span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>181</span> </span><span class="WHIT">            </span><span class="COMM">/** @type {Object} */</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'[object Function]'</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT">
<span class='line'>182</span> </span><span class="WHIT">            </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">val.call</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'>183</span> </span><span class="WHIT">            </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">val.propertyIsEnumerable</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'>184</span> </span><span class="WHIT">            </span><span class="PUNC">!</span><span class="NAME">val.propertyIsEnumerable</span><span class="PUNC">(</span><span class="STRN">'call'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>185</span> 
<span class='line'>186</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>187</span> 
<span class='line'>188</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>189</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>190</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>192</span> </span><span class="WHIT">    
<span class='line'>193</span>     
<span class='line'>194</span>     </span><span class="COMM">/**
<span class='line'>195</span>      * Copies all the members of a source object to a target object. WARNING:
<span class='line'>196</span>      * This includes items that aren't 'own' items!
<span class='line'>197</span>      * @param {Object} target Target.
<span class='line'>198</span>      * @param {Object} source Source.
<span class='line'>199</span>      */</span><span class="WHIT">
<span class='line'>200</span> </span><span class="WHIT">    </span><span class="NAME">this.mixin</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">target</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">source</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>201</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">x</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>202</span> </span><span class="WHIT">        </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">x</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">source</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>203</span> </span><span class="WHIT">            </span><span class="NAME">target</span><span class="PUNC">[</span><span class="NAME">x</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">source</span><span class="PUNC">[</span><span class="NAME">x</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>204</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>205</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>206</span> </span><span class="WHIT">    
<span class='line'>207</span> 
<span class='line'>208</span> 	</span><span class="COMM">/*************************************************************************\
<span class='line'>209</span> 	* >>> Public Methods
<span class='line'>210</span> 	\*************************************************************************/</span><span class="WHIT">
<span class='line'>211</span> 
<span class='line'>212</span> 
<span class='line'>213</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>214</span>      * Defines methods or properties of the &lt;code>BE&lt;/code> namespace if they
<span class='line'>215</span>      * do not exist.
<span class='line'>216</span>      *
<span class='line'>217</span>      * @param {String} ns_string The namespace structure to create rooted at
<span class='line'>218</span>      * BE.  &lt;code>BE&lt;/code> does not necessarily need to be a part of the
<span class='line'>219</span>      * structure.
<span class='line'>220</span>      * @returns {Object} The last object mentioned within the ns_string.
<span class='line'>221</span>      * @example
<span class='line'>222</span>      * BE.namespace("BE.obj1.obj2.property1") //Creates namespace structure and
<span class='line'>223</span>      *                                        //returns property1
<span class='line'>224</span>      */</span><span class="WHIT">
<span class='line'>225</span> </span><span class="WHIT">    </span><span class="NAME">this.namespace</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">ns_string</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>226</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">parts</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ns_string.split</span><span class="PUNC">(</span><span class="STRN">'.'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>227</span> </span><span class="WHIT">            </span><span class="NAME">parent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">BE</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>228</span> </span><span class="WHIT">            </span><span class="NAME">i</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>229</span> 
<span class='line'>230</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">parts</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"BE"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT">            </span><span class="NAME">parts</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parts.slice</span><span class="PUNC">(</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>232</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>233</span> 
<span class='line'>234</span> </span><span class="WHIT">        </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">parts.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>235</span> </span><span class="WHIT">            </span><span class="COMM">//Create the property if it doesn't exist</span><span class="WHIT">
<span class='line'>236</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">parent</span><span class="PUNC">[</span><span class="NAME">parts</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>237</span> </span><span class="WHIT">                </span><span class="NAME">parent</span><span class="PUNC">[</span><span class="NAME">parts</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>238</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>239</span> </span><span class="WHIT">            </span><span class="NAME">parent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parent</span><span class="PUNC">[</span><span class="NAME">parts</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>240</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>241</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">parent</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>242</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>243</span> 
<span class='line'>244</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'>245</span>      * Contains methods that help with debugging a script
<span class='line'>246</span> 	 * @memberOf BE
<span class='line'>247</span> 	 * @namespace
<span class='line'>248</span>      */</span><span class="WHIT">
<span class='line'>249</span> </span><span class="WHIT">    </span><span class="NAME">this.log</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>250</span> 
<span class='line'>251</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'>252</span> 	 * Log message type contstants. Values:
<span class='line'>253</span>      * &lt;ul>
<span class='line'>254</span>      * &lt;li>EXCEPTION&lt;/li>
<span class='line'>255</span>      * &lt;li>WARN&lt;/li>
<span class='line'>256</span>      * &lt;li>DEBUG&lt;/li>
<span class='line'>257</span>      * &lt;/ul>
<span class='line'>258</span>      * @constant
<span class='line'>259</span>      * @see BE.log
<span class='line'>260</span> 	 */</span><span class="WHIT">
<span class='line'>261</span> </span><span class="WHIT">	</span><span class="NAME">this.log.types</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>262</span> </span><span class="WHIT">		</span><span class="NAME">EXCEPTION</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"FATAL ERROR: "</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>263</span> </span><span class="WHIT">		</span><span class="NAME">WARN</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"WARNING: "</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>264</span> </span><span class="WHIT">        </span><span class="NAME">DEBUG</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"INFO: "</span><span class="WHIT">
<span class='line'>265</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>266</span> 
<span class='line'>267</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'>268</span>      * Writes a message out to the ExtendScript console. The individual
<span class='line'>269</span>      * &lt;code>BE.log.debug&lt;/code>, &lt;code>BE.log.warn&lt;/code> and
<span class='line'>270</span>      * &lt;code>BE.log.error&lt;/code> can be used as short forms for the
<span class='line'>271</span>      * functionality of this method.
<span class='line'>272</span>      *
<span class='line'>273</span>      * @example 
<span class='line'>274</span>      * BE.log.write(BE.log.types.DEBUG, 'This is a debug message');
<span class='line'>275</span>      * @param {BE.log.types} type The &lt;code>BE.log.type&lt;/code> to use for this
<span class='line'>276</span>      * log message
<span class='line'>277</span>      * @param {String} message The message to log
<span class='line'>278</span> 	 */</span><span class="WHIT">
<span class='line'>279</span> </span><span class="WHIT">    </span><span class="NAME">this.log.write</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">type</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>280</span> </span><span class="WHIT">		</span><span class="COMM">//Make sure the debug level is at least one greater than zero.</span><span class="WHIT">
<span class='line'>281</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">debug_</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>282</span> </span><span class="WHIT">            </span><span class="KEYW">switch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">type</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>283</span> </span><span class="WHIT">            </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">that.log.types.DEBUG</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>284</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">debug_</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT">                    </span><span class="NAME">$.writeln</span><span class="PUNC">(</span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>287</span> </span><span class="WHIT">                </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>288</span> </span><span class="WHIT">            </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">that.log.types.WARN</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>289</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">debug_</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>290</span> </span><span class="WHIT">                    </span><span class="NAME">$.writeln</span><span class="PUNC">(</span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>291</span> </span><span class="WHIT">                </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>292</span> </span><span class="WHIT">                </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>293</span> </span><span class="WHIT">            </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">that.log.types.EXCEPTION</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>294</span> </span><span class="WHIT">                </span><span class="NAME">$.writeln</span><span class="PUNC">(</span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>295</span> </span><span class="WHIT">                </span><span class="NAME">that.alertError</span><span class="PUNC">(</span><span class="STRN">""</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>296</span> </span><span class="WHIT">                </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>297</span> </span><span class="WHIT">            </span><span class="KEYW">default</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>298</span> </span><span class="WHIT">                </span><span class="NAME">$.writeln</span><span class="PUNC">(</span><span class="STRN">"INCORRECT ERROR TYPE SENT!"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>299</span> </span><span class="WHIT">                </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>300</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>301</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>302</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>303</span> 
<span class='line'>304</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>305</span>      * Outputs a warning message to the ExtendScript Toolkit console.
<span class='line'>306</span>      * @param {String} message The message to display
<span class='line'>307</span>      */</span><span class="WHIT">
<span class='line'>308</span> </span><span class="WHIT">    </span><span class="NAME">this.log.warn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>309</span> </span><span class="WHIT">        </span><span class="NAME">that.log.write</span><span class="PUNC">(</span><span class="NAME">that.log.types.WARN</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>310</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>311</span> 
<span class='line'>312</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>313</span>      * Outputs an info message to the ExtendScript Toolkit console.
<span class='line'>314</span>      * @param {String} message The message to display.
<span class='line'>315</span>      */</span><span class="WHIT">
<span class='line'>316</span> </span><span class="WHIT">    </span><span class="NAME">this.log.debug</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>317</span> </span><span class="WHIT">        </span><span class="NAME">that.log.write</span><span class="PUNC">(</span><span class="NAME">that.log.types.DEBUG</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>318</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>319</span> 
<span class='line'>320</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>321</span>      * Outputs an error message to the ExtendScript Toolkit console.
<span class='line'>322</span>      * @param {Error} e The error to output.
<span class='line'>323</span>      */</span><span class="WHIT">
<span class='line'>324</span> </span><span class="WHIT">    </span><span class="NAME">this.log.error</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>325</span> </span><span class="WHIT">        </span><span class="NAME">that.log.write</span><span class="PUNC">(</span><span class="NAME">that.log.types.EXCEPTION</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">e.toString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>326</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>327</span> 
<span class='line'>328</span> 
<span class='line'>329</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>330</span>      * Enters in a header message that visibly separates logs written by a
<span class='line'>331</span>      * specified script.
<span class='line'>332</span>      * @example
<span class='line'>333</span>      *      BE.log.insertLogStart('myfilename.jsx');
<span class='line'>334</span>      *      //Ouput:
<span class='line'>335</span>      *      ----------------
<span class='line'>336</span>      *      myfilename.jsx
<span class='line'>337</span>      *      &lt;CURRENT DATE HERE>
<span class='line'>338</span>      *      ----------------
<span class='line'>339</span>      * @param {String} s The name of the script to mention in the log start
<span class='line'>340</span>      * @returns Nothing.
<span class='line'>341</span>      */</span><span class="WHIT">
<span class='line'>342</span> </span><span class="WHIT">    </span><span class="NAME">this.log.insertLogStart</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>343</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">d</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>344</span> </span><span class="WHIT">            </span><span class="NAME">m</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"----------------\n"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>345</span> </span><span class="WHIT">               </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>346</span> </span><span class="WHIT">               </span><span class="NAME">d.toString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>347</span> </span><span class="WHIT">               </span><span class="STRN">"----------------"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>348</span> </span><span class="WHIT">        </span><span class="NAME">$.writeln</span><span class="PUNC">(</span><span class="NAME">m</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>349</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>350</span> 
<span class='line'>351</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>352</span>      * Inserts a horizontal rule in the log to visually separate the info to be
<span class='line'>353</span>      * written to the log.
<span class='line'>354</span>      * @example
<span class='line'>355</span>      *  BE.log.separate(1, '+', 5);
<span class='line'>356</span>      *  //Output:
<span class='line'>357</span>      *  
<span class='line'>358</span>      *  +++++
<span class='line'>359</span>      *  
<span class='line'>360</span>      * @param {Array|Int} [padding = 0] &lt;p>One of two types of values can be
<span class='line'>361</span>      * sent as the parameter for this method. If you pass an Integer or a
<span class='line'>362</span>      * single value Array, that many lines will be added before and after the
<span class='line'>363</span>      * separator.&lt;/p>
<span class='line'>364</span>      * 
<span class='line'>365</span>      * &lt;p>If you pass a two value Array, i.e. [1,2], the Integer at position 0
<span class='line'>366</span>      * is used to determine how many blank lines to place above the separator
<span class='line'>367</span>      * and the Integer at position [1] is used to determine how many blank
<span class='line'>368</span>      * lines to place below the separator.&lt;/p>
<span class='line'>369</span>      * 
<span class='line'>370</span>      * &lt;p>If the Array sent has a length greater than 2, only the first two
<span class='line'>371</span>      * indices are used.&lt;/p>
<span class='line'>372</span>      * @param {String} [s="-"] The character to use as the separator.
<span class='line'>373</span>      * @param {Number} [n = 15] How many characters to place within the horizontal
<span class='line'>374</span>      * separator line.
<span class='line'>375</span>      */</span><span class="WHIT">
<span class='line'>376</span> </span><span class="WHIT">    </span><span class="NAME">this.log.separate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">padding</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">n</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>377</span> 
<span class='line'>378</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">padBefore</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">padAfter</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">separatorString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>379</span> 
<span class='line'>380</span> </span><span class="WHIT">        </span><span class="NAME">padding</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">padding</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">padding</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>381</span> </span><span class="WHIT">        </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">"-"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>382</span> </span><span class="WHIT">        </span><span class="NAME">n</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">n</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NUMB">15</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">n</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>383</span> 
<span class='line'>384</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">padding</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>385</span> </span><span class="WHIT">            </span><span class="COMM">//How many dimensions?</span><span class="WHIT">
<span class='line'>386</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">padding.length</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>387</span> </span><span class="WHIT">                </span><span class="NAME">padBefore</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">padAfter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">padding</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>388</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">padding.length</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>389</span> </span><span class="WHIT">                </span><span class="NAME">padBefore</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">padding</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>390</span> </span><span class="WHIT">                </span><span class="NAME">padAfter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">padding</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>391</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>392</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">padding</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">String</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>393</span> </span><span class="WHIT">            </span><span class="NAME">padBefore</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">padAfter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">padding</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>394</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>395</span> 
<span class='line'>396</span> </span><span class="WHIT">        </span><span class="COMM">//Output any padding before this separator</span><span class="WHIT">
<span class='line'>397</span> </span><span class="WHIT">        </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">padBefore</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>398</span> </span><span class="WHIT">            </span><span class="NAME">$.writeln</span><span class="PUNC">(</span><span class="STRN">""</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>399</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>400</span> 
<span class='line'>401</span> </span><span class="WHIT">        </span><span class="COMM">//Output the separator</span><span class="WHIT">
<span class='line'>402</span> </span><span class="WHIT">        </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">n</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>403</span> </span><span class="WHIT">            </span><span class="NAME">separatorString</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>404</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>405</span> 
<span class='line'>406</span> </span><span class="WHIT">        </span><span class="NAME">$.writeln</span><span class="PUNC">(</span><span class="NAME">separatorString</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>407</span> 
<span class='line'>408</span> </span><span class="WHIT">        </span><span class="COMM">//Output any padding after this separator</span><span class="WHIT">
<span class='line'>409</span> </span><span class="WHIT">        </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">padAfter</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>410</span> </span><span class="WHIT">            </span><span class="NAME">$.writeln</span><span class="PUNC">(</span><span class="STRN">""</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>411</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>412</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>413</span> 
<span class='line'>414</span> </span><span class="WHIT">	</span><span class="COMM">/**
<span class='line'>415</span> 	 * Set the debug level for the &lt;code>BE.log&lt;/code> method.
<span class='line'>416</span> 	 * 
<span class='line'>417</span> 	 * The following levels are available:
<span class='line'>418</span> 	 * &lt;ul>
<span class='line'>419</span> 	 *  &lt;li>0 - Debug completely off.&lt;/li>
<span class='line'>420</span> 	 *  &lt;li>1 - Information displayed.&lt;/li>
<span class='line'>421</span> 	 *  &lt;li>2 - Warnings shown.&lt;/li>
<span class='line'>422</span> 	 * &lt;/ul>
<span class='line'>423</span> 	 * 
<span class='line'>424</span>      * @param {Number} l The level number to set as the debug level.
<span class='line'>425</span> 	 * @example
<span class='line'>426</span>      * BE.setDebugLevel(1);
<span class='line'>427</span> 	 * @returns Nothing.
<span class='line'>428</span> 	 * @see BE.log
<span class='line'>429</span> 	 */</span><span class="WHIT">
<span class='line'>430</span> </span><span class="WHIT">	</span><span class="NAME">this.setDebugLevel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">l</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>431</span> </span><span class="WHIT">		</span><span class="NAME">debug_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">l</span><span class="PUNC">;</span><span class="WHIT">	
<span class='line'>432</span> 	</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>433</span> 
<span class='line'>434</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>435</span>      * Returns the version string of the current &lt;code>BE&lt;/code> Object.
<span class='line'>436</span>      * 
<span class='line'>437</span>      * @returns {String} The &lt;code>BE&lt;/code> Object's version string.
<span class='line'>438</span>      */</span><span class="WHIT">
<span class='line'>439</span> </span><span class="WHIT">    </span><span class="NAME">this.getVersion</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>440</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">version_</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>441</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>442</span> </span><span class="WHIT">    
<span class='line'>443</span>     </span><span class="COMM">/**
<span class='line'>444</span>      * Alerts an Error Object, OR a String error, to the user. If the error
<span class='line'>445</span> 	 * message is greater than a preset amount, the error is displayed in a
<span class='line'>446</span> 	 * scrollable window.
<span class='line'>447</span>      *
<span class='line'>448</span>      * @param {String|Error} e If the argument is a String, this variable will
<span class='line'>449</span>      * be used to alert the string to the user. If it is an Error, the fields
<span class='line'>450</span>      * within the Error will be used to alert the user.
<span class='line'>451</span>      * @return Nothing.
<span class='line'>452</span>      */</span><span class="WHIT">
<span class='line'>453</span> </span><span class="WHIT">    </span><span class="NAME">this.alertError</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>454</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">errString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>455</span> </span><span class="WHIT">            </span><span class="NAME">eWindow</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>456</span> </span><span class="WHIT">			</span><span class="NAME">errStringMaxLength</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">100</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>457</span> 
<span class='line'>458</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>459</span> </span><span class="WHIT">			</span><span class="NAME">errString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e.description</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>460</span> </span><span class="WHIT">			</span><span class="NAME">errString</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.fileName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">"\n\nFile: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">e.fileName</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>461</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>462</span> </span><span class="WHIT">			</span><span class="NAME">errString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>463</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>464</span> 
<span class='line'>465</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">errString.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">errStringMaxLength</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>466</span> </span><span class="WHIT">			</span><span class="NAME">eWindow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Window</span><span class="PUNC">(</span><span class="STRN">"dialog"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>467</span> </span><span class="WHIT">					</span><span class="STRN">"Error!"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>468</span> </span><span class="WHIT">					</span><span class="NAME">undefined</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>469</span> </span><span class="WHIT">					</span><span class="PUNC">{</span><span class="NAME">resizeable</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>470</span> </span><span class="WHIT">					</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>471</span> 
<span class='line'>472</span> </span><span class="WHIT">			</span><span class="NAME">eWindow.grp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">eWindow.add</span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>473</span> </span><span class="WHIT">				</span><span class="STRN">"group { orientation: 'column', margins:0,"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>474</span> </span><span class="WHIT">					</span><span class="STRN">"alignment: ['fill','fill'], size: [350, 450],"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>475</span> </span><span class="WHIT">						</span><span class="STRN">"err: EditText {properties: {multiline:true},"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>476</span> </span><span class="WHIT">						</span><span class="STRN">"alignment: ['fill', 'fill'],"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>477</span> </span><span class="WHIT">							</span><span class="STRN">"size: [350,430]},"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>478</span> </span><span class="WHIT">						</span><span class="STRN">"b: Button {text: 'Ok'}"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>479</span> </span><span class="WHIT">				</span><span class="STRN">"}"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>480</span> 
<span class='line'>481</span> </span><span class="WHIT">			</span><span class="NAME">eWindow.grp.b.onClick</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>482</span> </span><span class="WHIT">				</span><span class="NAME">eWindow.close</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>483</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>484</span> 
<span class='line'>485</span> </span><span class="WHIT">			</span><span class="NAME">eWindow.center</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>486</span> </span><span class="WHIT">			</span><span class="NAME">eWindow.grp.err.text</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">errString</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>487</span> </span><span class="WHIT">			</span><span class="NAME">eWindow.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>488</span> 
<span class='line'>489</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>490</span> </span><span class="WHIT">		    </span><span class="NAME">alert</span><span class="PUNC">(</span><span class="NAME">errString</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>491</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>492</span> 
<span class='line'>493</span> </span><span class="WHIT">		</span><span class="NAME">that.log.warn</span><span class="PUNC">(</span><span class="NAME">errString</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>494</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>495</span> 
<span class='line'>496</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>497</span>      * Initializes the module and language includes. To reload a module, you
<span class='line'>498</span>      * can pass the name of the module (minus the file extension and "BE_") to
<span class='line'>499</span>      * the init method at any time.
<span class='line'>500</span>      * @param {String[]} [moduleList] An Array of module names to make
<span class='line'>501</span>      * available.  If blank, "all" or undefined, all modules will be loaded. If
<span class='line'>502</span>      * a module fails to load (either because there is an error within the
<span class='line'>503</span>      * module itself or the module doesn't exist) execution halts with an
<span class='line'>504</span>      * error.
<span class='line'>505</span>      * @returns {Boolean} True if te initialization was successful or false if it
<span class='line'>506</span>      * wasn't.
<span class='line'>507</span>      */</span><span class="WHIT">
<span class='line'>508</span> </span><span class="WHIT">    </span><span class="NAME">this.init</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">moduleList</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>509</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">inc</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>510</span> 
<span class='line'>511</span> </span><span class="WHIT">        </span><span class="COMM">//If the module list is not defined, set it to "all" </span><span class="WHIT">
<span class='line'>512</span> </span><span class="WHIT">        </span><span class="NAME">moduleList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">moduleList</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">moduleList</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">includes_</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>513</span> </span><span class="WHIT">        </span><span class="NAME">moduleList</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>514</span> 
<span class='line'>515</span> </span><span class="WHIT">        </span><span class="NAME">that.log.debug</span><span class="PUNC">(</span><span class="STRN">"Num Includes -> "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">includes_.length</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>516</span> 
<span class='line'>517</span> </span><span class="WHIT">        </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">inc</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">inc</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">moduleList.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">inc</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>518</span> </span><span class="WHIT">            </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>519</span> </span><span class="WHIT">                </span><span class="NAME">that.log.debug</span><span class="PUNC">(</span><span class="STRN">"Including -> "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>520</span> </span><span class="WHIT">                    </span><span class="STRN">"["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">inc</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"]"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">moduleList</span><span class="PUNC">[</span><span class="NAME">inc</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>521</span> </span><span class="WHIT">                </span><span class="NAME">$.evalFile</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">File</span><span class="PUNC">(</span><span class="NAME">includeFolder_</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">moduleList</span><span class="PUNC">[</span><span class="NAME">inc</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>522</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>523</span> </span><span class="WHIT">                </span><span class="NAME">that.alertError</span><span class="PUNC">(</span><span class="STRN">"There was an error while evaluating the "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>524</span> </span><span class="WHIT">                </span><span class="STRN">"includes. The following include failed: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">moduleList</span><span class="PUNC">[</span><span class="NAME">inc</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>525</span> </span><span class="WHIT">                </span><span class="STRN">"\n\nERROR:\n"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>526</span> 
<span class='line'>527</span> </span><span class="WHIT">                </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>528</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>529</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>530</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>531</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>532</span> </span><span class="WHIT">    
<span class='line'>533</span> 	</span><span class="COMM">/*************************************************************************\
<span class='line'>534</span> 	* >>> ERROR
<span class='line'>535</span> 	\*************************************************************************/</span><span class="WHIT">
<span class='line'>536</span> 
<span class='line'>537</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>538</span>      * Set of string error constants used by the global &lt;code>BE&lt;/code> Object.
<span class='line'>539</span> 	 * 
<span class='line'>540</span>      * The errors represented within this Object are not Error Objects; they
<span class='line'>541</span>      * are description strings.
<span class='line'>542</span> 	 * @namespace
<span class='line'>543</span>      * @constant
<span class='line'>544</span>      */</span><span class="WHIT">
<span class='line'>545</span> </span><span class="WHIT">    </span><span class="NAME">this.ERROR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>546</span> </span><span class="WHIT">		</span><span class="COMM">/**
<span class='line'>547</span> 		 * An error stating that there is no open After Effects
<span class='line'>548</span> 		 * project.
<span class='line'>549</span> 		 * @type {String}
<span class='line'>550</span> 		 */</span><span class="WHIT">
<span class='line'>551</span> </span><span class="WHIT">        </span><span class="NAME">NO_OPEN_PROJECT</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"An open project could not be found!"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>552</span> 
<span class='line'>553</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>554</span>          * An error stating the active item within the currently open After
<span class='line'>555</span>          * Effects file cannot be found.
<span class='line'>556</span>          * @type {String}
<span class='line'>557</span>          */</span><span class="WHIT">
<span class='line'>558</span> </span><span class="WHIT">        </span><span class="NAME">NO_ACTIVE_ITEM</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"The active item within the project could "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>559</span> </span><span class="WHIT">            </span><span class="STRN">"not be found!"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>560</span> 
<span class='line'>561</span> </span><span class="WHIT">        </span><span class="COMM">/**
<span class='line'>562</span>          * An error stating that the active composition within the currently
<span class='line'>563</span>          * open project could not be found.
<span class='line'>564</span>          * @type {String}
<span class='line'>565</span>          */</span><span class="WHIT">
<span class='line'>566</span> </span><span class="WHIT">        </span><span class="NAME">NO_ACTIVE_COMP</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"The active composition within the "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
<span class='line'>567</span> </span><span class="WHIT">            </span><span class="STRN">"project could not be found!"</span><span class="WHIT">
<span class='line'>568</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>569</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>570</span> </span><span class="PUNC">}</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>571</span> 
<span class='line'>572</span> </span><span class="COMM">//Initialize Before Effects</span><span class="WHIT">
<span class='line'>573</span> </span><span class="NAME">BE.init</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>574</span> </span></pre></body></html>